.class Lcom/burstly/lib/network/request/BurstlyRequestTask;
.super Lcom/burstly/lib/network/request/AbortableAsyncTask;
.source "BurstlyRequestTask.java"


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "<T:",
        "Ljava/lang/Object;",
        ">",
        "Lcom/burstly/lib/network/request/AbortableAsyncTask",
        "<TT;>;"
    }
.end annotation


# static fields
.field static final LOG:Lcom/burstly/lib/util/LoggerExt; = null

.field private static final MAX_RESPONSE_LENGTH:I = 0x186a0


# instance fields
.field private mCallback:Lcom/burstly/lib/network/request/IRequestCallback;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/burstly/lib/network/request/IRequestCallback",
            "<TT;>;"
        }
    .end annotation
.end field

.field private mObjToPost:Ljava/lang/Object;

.field private mResponseConverter:Lcom/burstly/lib/network/request/IResponseConverter;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/burstly/lib/network/request/IResponseConverter",
            "<TT;>;"
        }
    .end annotation
.end field

.field private mSerializedObjectToPost:Ljava/lang/String;

.field private final mTartgetClass:Ljava/lang/Class;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/lang/Class",
            "<TT;>;"
        }
    .end annotation
.end field


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 58
    invoke-static {}, Lcom/burstly/lib/util/LoggerExt;->getInstance()Lcom/burstly/lib/util/LoggerExt;

    move-result-object v0

    sput-object v0, Lcom/burstly/lib/network/request/BurstlyRequestTask;->LOG:Lcom/burstly/lib/util/LoggerExt;

    return-void
.end method

.method constructor <init>(Lcom/burstly/lib/network/beans/cookie/ICookieRequest;Ljava/lang/String;Ljava/lang/Class;Ljava/lang/String;)V
    .locals 2
    .parameter "postObject"
    .parameter "uri"
    .parameter
    .parameter "burstlyViewId"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lcom/burstly/lib/network/beans/cookie/ICookieRequest;",
            "Ljava/lang/String;",
            "Ljava/lang/Class",
            "<TT;>;",
            "Ljava/lang/String;",
            ")V"
        }
    .end annotation

    .prologue
    .line 97
    .local p0, this:Lcom/burstly/lib/network/request/BurstlyRequestTask;,"Lcom/burstly/lib/network/request/BurstlyRequestTask<TT;>;"
    .local p3, classToConvertResposeTo:Ljava/lang/Class;,"Ljava/lang/Class<TT;>;"
    invoke-direct {p0, p2, p4}, Lcom/burstly/lib/network/request/AbortableAsyncTask;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 98
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "Target class to convert can not be NULL."

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/Class;->getCanonicalName()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0, p3}, Ljunit/framework/Assert;->assertNotNull(Ljava/lang/String;Ljava/lang/Object;)V

    .line 100
    iput-object p3, p0, Lcom/burstly/lib/network/request/BurstlyRequestTask;->mTartgetClass:Ljava/lang/Class;

    .line 101
    invoke-static {p3}, Lcom/burstly/lib/network/request/ConverterFactory;->getConverter(Ljava/lang/Class;)Lcom/burstly/lib/network/request/IResponseConverter;

    move-result-object v0

    iput-object v0, p0, Lcom/burstly/lib/network/request/BurstlyRequestTask;->mResponseConverter:Lcom/burstly/lib/network/request/IResponseConverter;

    .line 102
    if-eqz p1, :cond_0

    .line 103
    iput-object p1, p0, Lcom/burstly/lib/network/request/BurstlyRequestTask;->mObjToPost:Ljava/lang/Object;

    .line 104
    invoke-interface {p1}, Lcom/burstly/lib/network/beans/cookie/ICookieRequest;->setValidCookies()V

    .line 106
    :cond_0
    return-void
.end method


# virtual methods
.method protected convertServerResponse(Ljava/lang/String;)Ljava/lang/Object;
    .locals 5
    .parameter "response"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            ")TT;"
        }
    .end annotation

    .prologue
    .line 218
    .local p0, this:Lcom/burstly/lib/network/request/BurstlyRequestTask;,"Lcom/burstly/lib/network/request/BurstlyRequestTask<TT;>;"
    iget-object v0, p0, Lcom/burstly/lib/network/request/BurstlyRequestTask;->mResponseConverter:Lcom/burstly/lib/network/request/IResponseConverter;

    if-eqz v0, :cond_0

    .line 219
    iget-object v0, p0, Lcom/burstly/lib/network/request/BurstlyRequestTask;->mResponseConverter:Lcom/burstly/lib/network/request/IResponseConverter;

    invoke-interface {v0, p1}, Lcom/burstly/lib/network/request/IResponseConverter;->convertResponse(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    .line 222
    :goto_0
    return-object v0

    .line 221
    :cond_0
    const/4 v0, 0x6

    const-string v1, "No valid converter could be found for {0}"

    const/4 v2, 0x1

    new-array v2, v2, [Ljava/lang/Object;

    const/4 v3, 0x0

    iget-object v4, p0, Lcom/burstly/lib/network/request/BurstlyRequestTask;->mTartgetClass:Ljava/lang/Class;

    invoke-virtual {v4}, Ljava/lang/Class;->getCanonicalName()Ljava/lang/String;

    move-result-object v4

    aput-object v4, v2, v3

    invoke-virtual {p0, v0, v1, v2}, Lcom/burstly/lib/network/request/BurstlyRequestTask;->logMessage(ILjava/lang/String;[Ljava/lang/Object;)V

    .line 222
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public getCallback()Lcom/burstly/lib/network/request/IRequestCallback;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Lcom/burstly/lib/network/request/IRequestCallback",
            "<TT;>;"
        }
    .end annotation

    .prologue
    .line 256
    .local p0, this:Lcom/burstly/lib/network/request/BurstlyRequestTask;,"Lcom/burstly/lib/network/request/BurstlyRequestTask<TT;>;"
    iget-object v0, p0, Lcom/burstly/lib/network/request/BurstlyRequestTask;->mCallback:Lcom/burstly/lib/network/request/IRequestCallback;

    return-object v0
.end method

.method protected getDataToPost()Ljava/lang/String;
    .locals 1

    .prologue
    .line 194
    .local p0, this:Lcom/burstly/lib/network/request/BurstlyRequestTask;,"Lcom/burstly/lib/network/request/BurstlyRequestTask<TT;>;"
    iget-object v0, p0, Lcom/burstly/lib/network/request/BurstlyRequestTask;->mObjToPost:Ljava/lang/Object;

    if-eqz v0, :cond_1

    .line 195
    iget-object v0, p0, Lcom/burstly/lib/network/request/BurstlyRequestTask;->mSerializedObjectToPost:Ljava/lang/String;

    if-nez v0, :cond_0

    .line 196
    iget-object v0, p0, Lcom/burstly/lib/network/request/BurstlyRequestTask;->mObjToPost:Ljava/lang/Object;

    invoke-static {v0}, Lcom/burstly/lib/util/Utils;->toJson(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/burstly/lib/network/request/BurstlyRequestTask;->mSerializedObjectToPost:Ljava/lang/String;

    .line 198
    :cond_0
    iget-object v0, p0, Lcom/burstly/lib/network/request/BurstlyRequestTask;->mSerializedObjectToPost:Ljava/lang/String;

    .line 200
    :goto_0
    return-object v0

    :cond_1
    const-string v0, ""

    goto :goto_0
.end method

.method public getTartgetClass()Ljava/lang/Class;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/lang/Class",
            "<TT;>;"
        }
    .end annotation

    .prologue
    .line 274
    .local p0, this:Lcom/burstly/lib/network/request/BurstlyRequestTask;,"Lcom/burstly/lib/network/request/BurstlyRequestTask<TT;>;"
    iget-object v0, p0, Lcom/burstly/lib/network/request/BurstlyRequestTask;->mTartgetClass:Ljava/lang/Class;

    return-object v0
.end method

.method protected handleConnectLogic(Lorg/apache/http/HttpHost;Lorg/apache/http/client/methods/HttpPost;)Ljava/lang/String;
    .locals 12
    .parameter "target"
    .parameter "postRequest"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/UnsupportedEncodingException;,
            Ljava/io/IOException;,
            Lorg/apache/http/client/ClientProtocolException;
        }
    .end annotation

    .prologue
    .line 157
    .local p0, this:Lcom/burstly/lib/network/request/BurstlyRequestTask;,"Lcom/burstly/lib/network/request/BurstlyRequestTask<TT;>;"
    invoke-virtual {p0}, Lcom/burstly/lib/network/request/BurstlyRequestTask;->getDataToPost()Ljava/lang/String;

    move-result-object v2

    .line 158
    .local v2, dataToPost:Ljava/lang/String;
    const/4 v7, 0x3

    const-string v8, "Request data to post to server: {0}"

    const/4 v9, 0x1

    new-array v9, v9, [Ljava/lang/Object;

    const/4 v10, 0x0

    aput-object v2, v9, v10

    invoke-virtual {p0, v7, v8, v9}, Lcom/burstly/lib/network/request/BurstlyRequestTask;->logMessage(ILjava/lang/String;[Ljava/lang/Object;)V

    .line 159
    new-instance v7, Lorg/apache/http/entity/StringEntity;

    const-string v8, "UTF-8"

    invoke-direct {v7, v2, v8}, Lorg/apache/http/entity/StringEntity;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {p2, v7}, Lorg/apache/http/client/methods/HttpPost;->setEntity(Lorg/apache/http/HttpEntity;)V

    .line 160
    invoke-static {p1, p2}, Lcom/burstly/lib/util/Utils;->makeRequest(Lorg/apache/http/HttpHost;Lorg/apache/http/client/methods/HttpRequestBase;)Lorg/apache/http/HttpResponse;

    move-result-object v5

    .line 161
    .local v5, response:Lorg/apache/http/HttpResponse;
    invoke-interface {v5}, Lorg/apache/http/HttpResponse;->getStatusLine()Lorg/apache/http/StatusLine;

    move-result-object v7

    invoke-interface {v7}, Lorg/apache/http/StatusLine;->getStatusCode()I

    move-result v6

    .line 162
    .local v6, statusCode:I
    const/16 v7, 0xc8

    if-eq v6, v7, :cond_0

    .line 164
    const/4 v7, 0x6

    const-string v8, "Request to {0} has finished with {1} http status."

    const/4 v9, 0x2

    new-array v9, v9, [Ljava/lang/Object;

    const/4 v10, 0x0

    invoke-virtual {p1}, Lorg/apache/http/HttpHost;->getHostName()Ljava/lang/String;

    move-result-object v11

    aput-object v11, v9, v10

    const/4 v10, 0x1

    invoke-static {v6}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v11

    aput-object v11, v9, v10

    invoke-virtual {p0, v7, v8, v9}, Lcom/burstly/lib/network/request/BurstlyRequestTask;->logMessage(ILjava/lang/String;[Ljava/lang/Object;)V

    .line 166
    const/4 v4, 0x0

    .line 177
    :goto_0
    return-object v4

    .line 168
    :cond_0
    invoke-interface {v5}, Lorg/apache/http/HttpResponse;->getEntity()Lorg/apache/http/HttpEntity;

    move-result-object v3

    .line 169
    .local v3, entity:Lorg/apache/http/HttpEntity;
    invoke-interface {v3}, Lorg/apache/http/HttpEntity;->getContentLength()J

    move-result-wide v0

    .line 170
    .local v0, contentLength:J
    const-wide/32 v7, 0x186a0

    cmp-long v7, v0, v7

    if-ltz v7, :cond_1

    .line 171
    const/4 v7, 0x6

    const-string v8, "Response length is too big to handle: {0}"

    const/4 v9, 0x1

    new-array v9, v9, [Ljava/lang/Object;

    const/4 v10, 0x0

    invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v11

    aput-object v11, v9, v10

    invoke-virtual {p0, v7, v8, v9}, Lcom/burstly/lib/network/request/BurstlyRequestTask;->logMessage(ILjava/lang/String;[Ljava/lang/Object;)V

    .line 172
    const/4 v4, 0x0

    goto :goto_0

    .line 174
    :cond_1
    const/4 v7, 0x3

    const-string v8, "Raw response data length: {0}"

    const/4 v9, 0x1

    new-array v9, v9, [Ljava/lang/Object;

    const/4 v10, 0x0

    invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v11

    aput-object v11, v9, v10

    invoke-virtual {p0, v7, v8, v9}, Lcom/burstly/lib/network/request/BurstlyRequestTask;->logMessage(ILjava/lang/String;[Ljava/lang/Object;)V

    .line 175
    const-string v7, "UTF-8"

    invoke-static {v3, v7}, Lorg/apache/http/util/EntityUtils;->toString(Lorg/apache/http/HttpEntity;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    .line 176
    .local v4, rawResponseData:Ljava/lang/String;
    const/4 v7, 0x3

    const-string v8, "Raw response data: {0}"

    const/4 v9, 0x1

    new-array v9, v9, [Ljava/lang/Object;

    const/4 v10, 0x0

    aput-object v4, v9, v10

    invoke-virtual {p0, v7, v8, v9}, Lcom/burstly/lib/network/request/BurstlyRequestTask;->logMessage(ILjava/lang/String;[Ljava/lang/Object;)V

    goto :goto_0
.end method

.method varargs logMessage(ILjava/lang/String;[Ljava/lang/Object;)V
    .locals 3
    .parameter "logLevel"
    .parameter "message"
    .parameter "params"

    .prologue
    .line 233
    .local p0, this:Lcom/burstly/lib/network/request/BurstlyRequestTask;,"Lcom/burstly/lib/network/request/BurstlyRequestTask<TT;>;"
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "(BVID: "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {p0}, Lcom/burstly/lib/network/request/BurstlyRequestTask;->getBurstlyViewId()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, ") "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    .line 234
    .local v0, msg:Ljava/lang/String;
    packed-switch p1, :pswitch_data_0

    .line 248
    sget-object v1, Lcom/burstly/lib/network/request/BurstlyRequestTask;->LOG:Lcom/burstly/lib/util/LoggerExt;

    const-string v2, "BurstlyRequestTask"

    invoke-virtual {v1, v2, v0, p3}, Lcom/burstly/lib/util/LoggerExt;->logDebug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 250
    :goto_0
    return-void

    .line 236
    :pswitch_0
    sget-object v1, Lcom/burstly/lib/network/request/BurstlyRequestTask;->LOG:Lcom/burstly/lib/util/LoggerExt;

    const-string v2, "BurstlyRequestTask"

    invoke-virtual {v1, v2, v0, p3}, Lcom/burstly/lib/util/LoggerExt;->logDebug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    goto :goto_0

    .line 239
    :pswitch_1
    sget-object v1, Lcom/burstly/lib/network/request/BurstlyRequestTask;->LOG:Lcom/burstly/lib/util/LoggerExt;

    const-string v2, "BurstlyRequestTask"

    invoke-virtual {v1, v2, v0, p3}, Lcom/burstly/lib/util/LoggerExt;->logError(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    goto :goto_0

    .line 242
    :pswitch_2
    sget-object v1, Lcom/burstly/lib/network/request/BurstlyRequestTask;->LOG:Lcom/burstly/lib/util/LoggerExt;

    const-string v2, "BurstlyRequestTask"

    invoke-virtual {v1, v2, v0, p3}, Lcom/burstly/lib/util/LoggerExt;->logInfo(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    goto :goto_0

    .line 245
    :pswitch_3
    sget-object v1, Lcom/burstly/lib/network/request/BurstlyRequestTask;->LOG:Lcom/burstly/lib/util/LoggerExt;

    const-string v2, "BurstlyRequestTask"

    invoke-virtual {v1, v2, v0, p3}, Lcom/burstly/lib/util/LoggerExt;->logWarning(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    goto :goto_0

    .line 234
    :pswitch_data_0
    .packed-switch 0x3
        :pswitch_0
        :pswitch_2
        :pswitch_3
        :pswitch_1
    .end packed-switch
.end method

.method protected onPostExecute(Ljava/lang/Object;)V
    .locals 2
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(TT;)V"
        }
    .end annotation

    .prologue
    .local p0, this:Lcom/burstly/lib/network/request/BurstlyRequestTask;,"Lcom/burstly/lib/network/request/BurstlyRequestTask<TT;>;"
    .local p1, result:Ljava/lang/Object;,"TT;"
    const/4 v1, 0x0

    .line 205
    iget-object v0, p0, Lcom/burstly/lib/network/request/BurstlyRequestTask;->mCallback:Lcom/burstly/lib/network/request/IRequestCallback;

    if-eqz v0, :cond_0

    invoke-virtual {p0}, Lcom/burstly/lib/network/request/BurstlyRequestTask;->isAborted()Z

    move-result v0

    if-nez v0, :cond_0

    .line 206
    if-eqz p1, :cond_1

    .line 207
    iget-object v0, p0, Lcom/burstly/lib/network/request/BurstlyRequestTask;->mCallback:Lcom/burstly/lib/network/request/IRequestCallback;

    invoke-interface {v0, p1}, Lcom/burstly/lib/network/request/IRequestCallback;->onSuccessUi(Ljava/lang/Object;)V

    .line 211
    :goto_0
    iput-object v1, p0, Lcom/burstly/lib/network/request/BurstlyRequestTask;->mCallback:Lcom/burstly/lib/network/request/IRequestCallback;

    .line 213
    :cond_0
    invoke-super {p0, p1}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->onPostExecute(Ljava/lang/Object;)V

    .line 214
    return-void

    .line 209
    :cond_1
    iget-object v0, p0, Lcom/burstly/lib/network/request/BurstlyRequestTask;->mCallback:Lcom/burstly/lib/network/request/IRequestCallback;

    invoke-interface {v0, v1}, Lcom/burstly/lib/network/request/IRequestCallback;->onFailUi(Ljava/lang/Object;)V

    goto :goto_0
.end method

.method protected onPreExecute()V
    .locals 1

    .prologue
    .line 182
    .local p0, this:Lcom/burstly/lib/network/request/BurstlyRequestTask;,"Lcom/burstly/lib/network/request/BurstlyRequestTask<TT;>;"
    invoke-super {p0}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->onPreExecute()V

    .line 183
    iget-object v0, p0, Lcom/burstly/lib/network/request/BurstlyRequestTask;->mCallback:Lcom/burstly/lib/network/request/IRequestCallback;

    if-eqz v0, :cond_0

    .line 184
    iget-object v0, p0, Lcom/burstly/lib/network/request/BurstlyRequestTask;->mCallback:Lcom/burstly/lib/network/request/IRequestCallback;

    invoke-interface {v0}, Lcom/burstly/lib/network/request/IRequestCallback;->preExecute()V

    .line 186
    :cond_0
    return-void
.end method

.method protected performInBackground()Ljava/lang/Object;
    .locals 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()TT;"
        }
    .end annotation

    .prologue
    .line 134
    .local p0, this:Lcom/burstly/lib/network/request/BurstlyRequestTask;,"Lcom/burstly/lib/network/request/BurstlyRequestTask<TT;>;"
    invoke-super {p0}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->performInBackground()Ljava/lang/Object;

    move-result-object v0

    .line 135
    .local v0, result:Ljava/lang/Object;,"TT;"
    iget-object v1, p0, Lcom/burstly/lib/network/request/BurstlyRequestTask;->mCallback:Lcom/burstly/lib/network/request/IRequestCallback;

    if-eqz v1, :cond_0

    invoke-virtual {p0}, Lcom/burstly/lib/network/request/BurstlyRequestTask;->isAborted()Z

    move-result v1

    if-nez v1, :cond_0

    .line 136
    if-eqz v0, :cond_1

    .line 137
    iget-object v1, p0, Lcom/burstly/lib/network/request/BurstlyRequestTask;->mCallback:Lcom/burstly/lib/network/request/IRequestCallback;

    invoke-interface {v1, v0}, Lcom/burstly/lib/network/request/IRequestCallback;->onSuccessInBackground(Ljava/lang/Object;)V

    .line 142
    :cond_0
    :goto_0
    return-object v0

    .line 139
    :cond_1
    iget-object v1, p0, Lcom/burstly/lib/network/request/BurstlyRequestTask;->mCallback:Lcom/burstly/lib/network/request/IRequestCallback;

    const/4 v2, 0x0

    invoke-interface {v1, v2}, Lcom/burstly/lib/network/request/IRequestCallback;->onFailInBackground(Ljava/lang/Object;)V

    goto :goto_0
.end method

.method public setCallback(Lcom/burstly/lib/network/request/IRequestCallback;)V
    .locals 0
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lcom/burstly/lib/network/request/IRequestCallback",
            "<TT;>;)V"
        }
    .end annotation

    .prologue
    .line 265
    .local p0, this:Lcom/burstly/lib/network/request/BurstlyRequestTask;,"Lcom/burstly/lib/network/request/BurstlyRequestTask<TT;>;"
    .local p1, callback:Lcom/burstly/lib/network/request/IRequestCallback;,"Lcom/burstly/lib/network/request/IRequestCallback<TT;>;"
    iput-object p1, p0, Lcom/burstly/lib/network/request/BurstlyRequestTask;->mCallback:Lcom/burstly/lib/network/request/IRequestCallback;

    .line 266
    return-void
.end method

.method protected tryToConnect(Lorg/apache/http/HttpHost;Lorg/apache/http/client/methods/HttpPost;)Ljava/lang/String;
    .locals 9
    .parameter "target"
    .parameter "postRequest"

    .prologue
    .local p0, this:Lcom/burstly/lib/network/request/BurstlyRequestTask;,"Lcom/burstly/lib/network/request/BurstlyRequestTask<TT;>;"
    const/4 v4, 0x2

    const/4 v8, 0x5

    const/4 v7, 0x1

    const/4 v6, 0x0

    .line 116
    :try_start_0
    invoke-virtual {p0, p1, p2}, Lcom/burstly/lib/network/request/BurstlyRequestTask;->handleConnectLogic(Lorg/apache/http/HttpHost;Lorg/apache/http/client/methods/HttpPost;)Ljava/lang/String;
    :try_end_0
    .catch Lorg/apache/http/conn/ConnectTimeoutException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/net/SocketTimeoutException; {:try_start_0 .. :try_end_0} :catch_1
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_2

    move-result-object v3

    .line 129
    :goto_0
    return-object v3

    .line 118
    :catch_0
    move-exception v0

    .line 119
    .local v0, cte:Lorg/apache/http/conn/ConnectTimeoutException;
    const-string v3, "Could not establish connection for {0} to {1} host"

    new-array v4, v4, [Ljava/lang/Object;

    invoke-static {}, Lcom/burstly/lib/network/TimeoutManager;->getConnectTimeout()I

    move-result v5

    invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v5

    aput-object v5, v4, v6

    invoke-virtual {p1}, Lorg/apache/http/HttpHost;->getHostName()Ljava/lang/String;

    move-result-object v5

    aput-object v5, v4, v7

    invoke-virtual {p0, v8, v3, v4}, Lcom/burstly/lib/network/request/BurstlyRequestTask;->logMessage(ILjava/lang/String;[Ljava/lang/Object;)V

    .line 129
    .end local v0           #cte:Lorg/apache/http/conn/ConnectTimeoutException;
    :goto_1
    const/4 v3, 0x0

    goto :goto_0

    .line 122
    :catch_1
    move-exception v2

    .line 123
    .local v2, ste:Ljava/net/SocketTimeoutException;
    const-string v3, "Could not get response for {0} millisec from {1}"

    new-array v4, v4, [Ljava/lang/Object;

    invoke-static {}, Lcom/burstly/lib/network/TimeoutManager;->getReadimeout()I

    move-result v5

    invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v5

    aput-object v5, v4, v6

    invoke-virtual {p1}, Lorg/apache/http/HttpHost;->getHostName()Ljava/lang/String;

    move-result-object v5

    aput-object v5, v4, v7

    invoke-virtual {p0, v8, v3, v4}, Lcom/burstly/lib/network/request/BurstlyRequestTask;->logMessage(ILjava/lang/String;[Ljava/lang/Object;)V

    goto :goto_1

    .line 126
    .end local v2           #ste:Ljava/net/SocketTimeoutException;
    :catch_2
    move-exception v1

    .line 127
    .local v1, e:Ljava/lang/Exception;
    const-string v3, "Request to {0} failed."

    new-array v4, v7, [Ljava/lang/Object;

    invoke-virtual {p1}, Lorg/apache/http/HttpHost;->getHostName()Ljava/lang/String;

    move-result-object v5

    aput-object v5, v4, v6

    invoke-virtual {p0, v8, v3, v4}, Lcom/burstly/lib/network/request/BurstlyRequestTask;->logMessage(ILjava/lang/String;[Ljava/lang/Object;)V

    goto :goto_1
.end method
